package com.sky.WebSocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;



@Component
@Slf4j
public class WebSocketTask {

    @Autowired
    private WebSocketServer webSocketServer;

    /**
     * 通过WebSocket每隔30秒向客户端发送消息
     */
   // @Scheduled(cron = "0/30 * * * * ?")
    public void sendMessageToClient() {
        webSocketServer.sendToAllClient("这是来自服务端的消息：" );
    }


    /**
     * 取消订单 需要电话沟通的方法
     * @param yuanYin
     */
    public void iponeGouTong(String yuanYin){
        webSocketServer.SendOrderComeReminder("yuanYin");

    }
}
